﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Mvc;
using OrderingPlatform.MvcExtension;

namespace OrderingPlatform.WebUI.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            //if (HttpContext.Request.Url != null)
            //{
            //    var url = HttpContext.Request.Url.Host;
            //    if (!url.Contains("dingcan777"))
            //    {
            //        var str =
            //            string.Format(
            //                "<div style=\"text-align: center;margin-top: 100px;\"><h2>{0}</h2><h3>此域名出售，联系方式:</h3><h3>电话：13621869317，QQ:404268843</h3></div>",
            //                url);
            //        return Content(str);
            //        //return RedirectToAction("Domain", new { d = url });
            //    }


            //}
            return View();
        }

        public ActionResult Domain(string d)
        {
            ViewBag.Domain = d;
            return View();
        }
        public ActionResult Demo()
        {
            //var result = HttpVisitGetData.GetContentBaseGet("http://api.map.baidu.com/location/ip",
            //                                  "ak=2E28FD2f3e759b9077f2e84912b9d94d&ip=&coor=wgs84ll");
            //result = Regex.Unescape(result);
            //ViewBag.Result = result;
            //result = HttpVisitGetData.GetContentBaseGet("http://api.map.baidu.com/geocoder/v2/",
            //                                            "ak=2E28FD2f3e759b9077f2e84912b9d94d&callback=renderReverse&location=31.283666480637,121.46236560073&output=json&pois=1");

            //result = Regex.Unescape(result);
            //ViewBag.Result += result;

            //result = HttpVisitGetData.GetContentBaseGet("http://api.map.baidu.com/geocoder/v2/",
            //                                            "ak=2E28FD2f3e759b9077f2e84912b9d94d&callback=&output=json&address=广延路383号文武大楼&city=上海市");
            //result = Regex.Unescape(result);
            //ViewBag.Result += result;

            return View();
        }
    }
}
